package com.mxwl.cbg.common.model.source.role;

import lombok.Data;

import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * 召唤兽数据字体类
 */
@Data
public class CallHorse {
    private int fin_jinjie;
    private int ori_type;
    private SummonEquip summon_equip1;
    private int iRes_all;
    private SummonEquip summon_equip3;
    private SummonEquip summon_equip2;
    private int iRealColor;
    private int iAtt_all;
    private List<AvtInfo> avt_list;
    private int iStr_all;
    private int iAtt_F;
    private int iGrade;
    private int iMp_max;
    private int iGenius;
    private Jinjie jinjie;
    private int iDex_All;
    private int spe;
    private int iType;
    private String summon_equip4_desc;
    private int iDef_All;
    private int iPoint;
    private int iHp;
    private String sumavt_propsk;
    private int ruyidan;
    private String csavezz;
    private Map<String, List<Object>> summon_core;
    private int iColor;
    private int att_rate;
    private int iBaobao;
    private int mp;
    private int summon_equip4_type;
    private int life;
    private int lastchecksubzz;
    private int HP_MAX;
    private int iMag_all;
    private int iJjFeedCd;
    private int hp;
    private int iMagDam;
    private int iMagDef;
    private int summon_color;
    private int qianjinlu;
    private int iMagDef_all;
    private int iMp;
    private int jj_extra_add;
    private String color_str;
    private int lianshou;
    private String EvolSkill;
    private int grow;
    private int is_super_sum;
    private int iHp_max;
    private int shape_num;
    private int can_split_agent;
    private int ATK_MAX;
    private int tmp_lingxing;
    private int SPD_MAX;
    private Map<String, Integer> all_skills;
    private String equip_sn;
    private int iDod_All;
    private int DEF_MAX;
    private int MP_MAX;
    private int iSpe_all;
    private int left_qlxl;
    private int iLock;
    private int carrygradezz;
    private int dod;
    private int core_close;
    private int att;
    private int MS_MAX;
    private int yuanxiao;
    private int iCor_all;
    private int growthMax;
    private int jinjie_type;
    private int sjg;
    private int def;


    // 提供一个 setter 方法，兼容 Integer 类型输入
    public void setAll_skills(Object value) {
        if (value instanceof Map) {
            this.all_skills = (Map<String, Integer>) value;
        } else if (value instanceof Integer || value instanceof String) {
            // 忽略非法值或初始化为空 map
            this.all_skills = Collections.emptyMap();
        }
    }

    public Map<String, Integer> getAll_skills() {
        return all_skills == null ? Collections.emptyMap() : all_skills;
    }

    // 嵌套类定义
    public static class SummonEquip {
        private int iLock;
        private int iType;
        private String cDesc;
    }

    public static class AvtInfo {
        private int type;
        private List<?> suit_list;
        private int color_s;
        private int in_use;
        private int color_h;
    }

    public static class Jinjie {
        private Core core;
        private int cnt;
        private int lx;
        private int new_type;
    }

    public static class Core {
        private String effect;
        private int id;
        private String name;
        private int fix_st;
    }
}
